package com.situ.mall.admin.mapper;

import com.situ.mall.admin.entity.Administrator;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author darling
 * @since 2023-03-17
 */
public interface AdministratorMapper extends BaseMapper<Administrator> {
    Administrator check(String username);

    List<Administrator> doList(String keyword);

    @Select("SELECT * FROM t_administrator WHERE username = #{username}")
    Administrator selectByUsername(String username);

    @Update("UPDATE t_administrator SET password = #{newPwd} WHERE id = #{id}")
    void changePwd(@Param("newPwd") String newPwd, @Param("id") Integer id);

}
